//
//  StoreButtonCell.m
//  NPS
//
//  Created by jadd on 15/10/12.
//  Copyright © 2015年 jadd. All rights reserved.
//

#import "StoreButtonCell.h"

@implementation StoreButtonCell
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
- (id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {

        [self setBackgroundColor:[UIColor clearColor]];
        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
        
        _button = [UIButton buttonWithType:UIButtonTypeSystem];
        //[_button setHighlighted:YES];
        [_button.layer setMasksToBounds:YES];
        [_button.layer setCornerRadius:5.0f];
        [_button.layer setBorderWidth:0.5f];
        UIFont *font = [UIFont systemFontOfSize:18.0];
        UIFont *font2= [UIFont systemFontOfSize:20.0];
        
        NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"+添加店铺"];
        
        [string addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, string.length)];
        [string addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, 1)];
        [string addAttribute:NSFontAttributeName value:font2 range:NSMakeRange(1, string.length-1)];
        [_button setAttributedTitle:string forState:UIControlStateNormal];
        
        [_button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_button.layer setBorderColor:DEFAULT_LINE_GRAY_COLOR.CGColor];
        _button.backgroundColor = BButtonTypeWarning;
        [_button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self addSubview:_button];
    }
    return self;
}

@end
